package com.zhenyi.toupiao.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.StrKit;

public class TPInerceptor implements Interceptor {

	@Override
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		String code = controller.getPara(0);
		if (StrKit.isBlank(code)) {
			controller.renderError(404);
			return;
		}
		inv.invoke();
	}

}
